# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=maui

# optional dependencies:
# * kio-extras: to enable thumbnails in the file browser
# * udisks2: for browsing mount points
pkgname=nota
pkgver=4.0.0
pkgrel=0
pkgdesc="Nota is a simple and convergent text editor"
# armhf blocked by qt5-qtdeclarative
# s390x, ppc64le, riscv64 and loongarch64 blocked by qt5-qtwebengine
arch="all !armhf !s390x !ppc64le !riscv64 !loongarch64"
url="https://invent.kde.org/maui/nota"
license="GPL-2.0-or-later"
depends="
	kde-icons
	mauikit-texteditor
	qmltermwidget
	qt6-qtbase-sqlite
	"
makedepends="
	attica-dev
	extra-cmake-modules
	kconfig-dev
	ki18n-dev
	kio-dev
	knotifications-dev
	mauikit-dev
	mauikit-filebrowsing-dev
	mauikit-texteditor-dev
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	qt6-qtsvg-dev
	qt6-qtwebengine-dev
	samurai
	syntax-highlighting-dev
	"
subpackages="$pkgname-lang"
_repo_url="https://invent.kde.org/maui/nota.git"
source="https://download.kde.org/stable/maui/nota/$pkgver/nota-$pkgver.tar.xz
	0001-$pkgname-Fix-build.patch::https://invent.kde.org/maui/nota/-/merge_requests/10.patch
	"
options="!check" # No tests available

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
fc9db19feff2b70cacb41fec33a2f0afe411f53fcbc10127557f9123713a46584ac2e798767e58aac9c2f25124a7ebfa0b769de99fc245c028c5ed2e91da9546  nota-4.0.0.tar.xz
604f51044de8d25dab1aece91661031cabb2874f98563ae63d20ba4e23b81eee094bdbfc8c073d56a9a8f07d27d9c89d141f81ca2a922a724f447693a3371881  0001-nota-Fix-build.patch
"
